#include "header.h"

character::character()
{
  hp = 1000;
  maxhp = 1000;
  
}
double character::resistFactor(gemElement aelement, gemElement delement)
{
  double total=1;
  switch (delement)
  {
    case light:
      if (delement==light) total*=.5;
      if (delement==dark) total*=1.5;
      break;
    case fire:
      if (delement==fire) total*=0;
      if (delement==elec) total*=.5;
      if (delement==water) total*=2;
      if (delement==ice) total*=1.5;
      break;
    case water:
      if (delement==water) total*=0;
      if (delement==earth) total*=.5;
      if (delement==air) total*=2;
      if (delement==elec) total*=1.5;
      break;
    case air:
      if (delement==air) total*=0;
      if (delement==ice) total*=.5;
      if (delement==fire) total*=2;
      if (delement==earth) total*=1.5;
      break;
    case elec:
      if (delement==elec) total*=0;
      if (delement==fire) total*=.5;
      if (delement==earth) total*=2;
      break;
    case earth:
      if (delement==earth) total*=0;
      if (delement==water) total*=.5;
      if (delement==ice) total*=2;
      break;
    case ice:
      if (delement==ice) total*=0;
      if (delement==air) total*=.5;
      if (delement==elec) total*2;
      break;
    case dark:
      if (delement==dark) total*=.5;
      if (delement==light) total*=1.5;
    
  } // end element switch
} // end function
